layui.define(function (I) {
    function A(a) {
        var b = parseInt(a.data("indent")), c = a.hasClass("v-tree-table-open");
        if (c) a.removeClass("v-tree-table-open"), a.nextAll("tr").each(function () {
            if (parseInt(k(this).data("indent")) <= b) return !1;
            k(this).addClass("v-tree-tb-hide")
        }); else {
            a.addClass("v-tree-table-open");
            var g;
            a.nextAll("tr").each(function () {
                var e = parseInt(k(this).data("indent"));
                if (e <= b) return !1;
                if (void 0 !== g && e > g) return !0;
                k(this).removeClass("v-tree-tb-hide");
                g = k(this).hasClass("v-tree-table-open") ?
                    void 0 : parseInt(k(this).data("indent"))
            })
        }
        y(a.parentsUntil(".v-tree-table").last().parent());
        return c
    }

    function y(a) {
        var b = a.children(".v-tree-table-head");
        a = a.children(".v-tree-table-box");
        a = a.width() - a.prop("clientWidth");
        b.css("border-right", (0 < a ? a : 0) + "px solid #f2f2f2")
    }

    function B() {
        k(".v-tree-table-cell").removeClass("v-tree-tips-open v-show-left v-show-bottom");
        k(".v-tree-table-cell>.v-tree-table-cell-content").css({width: "", "max-width": ""})
    }

    function C(a) {
        return null === a ? "Null" : void 0 === a ? "Undefined" :
            Object.prototype.toString.call(a).slice(8, -1)
    }

    var k = layui.jquery, D = layui.laytpl, w = layui.form, G = layui.util, E = layui.device(), F = {}, J = {
        elem: void 0,
        cols: void 0,
        url: void 0,
        method: void 0,
        where: void 0,
        contentType: void 0,
        headers: void 0,
        parseData: void 0,
        request: {pidName: "pid"},
        toolbar: void 0,
        defaultToolbar: void 0,
        width: void 0,
        height: void 0,
        cellMinWidth: 90,
        done: void 0,
        data: void 0,
        title: void 0,
        skin: void 0,
        even: void 0,
        size: void 0,
        text: {none: "\u65e0\u6570\u636e"},
        reqData: void 0,
        useAdmin: !1,
        tree: {
            idName: "id",
            pidName: "pid",
            childName: "children",
            haveChildName: "haveChild",
            haveChildReverse: !1,
            openName: "open",
            iconIndex: 0,
            arrowType: void 0,
            onlyIconControl: void 0,
            getIcon: function (a) {
                var b = a[this.haveChildName];
                void 0 !== b ? (b = !0 === b || "true" === b, this.haveChildReverse && (b = !b)) : a[this.childName] && (b = 0 < a[this.childName].length);
                return b ? '<i class="v-tree-icon layui-icon layui-icon-layer"></i>' : '<i class="v-tree-icon layui-icon layui-icon-file"></i>'
            }
        }
    }, H = {
        field: void 0,
        title: void 0,
        width: void 0,
        minWidth: void 0,
        type: "normal",
        fixed: void 0,
        hide: void 0,
        unresize: void 0,
        style: void 0,
        align: void 0,
        colspan: void 0,
        rowspan: void 0,
        templet: void 0,
        toolbar: void 0,
        class: void 0,
        singleLine: void 0
    }, p = function (a) {
        F[a.elem.substring(1)] = this;
        this.reload(a)
    };
    p.prototype.findDataById = function (a) {
        function b(g) {
            for (var e = 0; e < g.length; e++) {
                if (g[e][c.tree.idName] === a) return g[e];
                if (g[e][c.tree.childName]) {
                    var d = b(g[e][c.tree.childName]);
                    if (d) return d
                }
            }
        }

        var c = this.options;
        return b(c.data)
    };
    p.prototype.initOptions = function (a) {
        function b(n) {
            n.INIT_OK || (n = k.extend({INIT_OK: !0},
                H, n));
            if ("space" === n.type) n.width || (n.width = 15), n.minWidth = n.width; else if ("numbers" === n.type) n.width || (n.width = 40), n.minWidth = n.width, n.singleLine || (n.singleLine = !1), n.unresize || (n.unresize = !0), n.align || (n.align = "center"); else if ("checkbox" === n.type || "radio" === n.type) n.width || (n.width = 48), n.minWidth = n.width, n.singleLine || (n.singleLine = !1), n.unresize || (n.unresize = !0), n.align || (n.align = "center");
            n.toolbar && (n.type = "tool");
            return n
        }

        var c = this;
        "Array" !== C(a.cols[0]) && (a.cols = [a.cols]);
        for (var g = 0; g <
        a.cols.length; g++) for (var e = 0; e < a.cols[g].length; e++) a.cols[g][e].INIT_OK = void 0, a.cols[g][e].key = void 0, a.cols[g][e].colGroup = void 0, a.cols[g][e].HAS_PARENT = void 0, a.cols[g][e].parentKey = void 0, a.cols[g][e].PARENT_COL_INDEX = void 0;
        g = [];
        for (var d = e = 0; d < a.cols.length; d++) for (var f = a.cols[d], h = 0; h < f.length; h++) {
            var l = f[h];
            if (l) {
                l = b(l);
                l.key = d + "-" + h;
                var m = void 0;
                if (l.colGroup || 1 < l.colspan) {
                    l.colGroup = !0;
                    l.type = "group";
                    m = [];
                    e++;
                    for (var t = 0, r = 0; r < a.cols[d + 1].length; r++) {
                        var q = k.extend({INIT_OK: !0}, H, a.cols[d +
                        1][r]);
                        q.HAS_PARENT || 1 < t && t == l.colspan || (q.HAS_PARENT = !0, q.parentKey = d + "-" + h, q.key = d + 1 + "-" + r, q.PARENT_COL_INDEX = e, q = b(q), m.push(q), t += parseInt(1 < q.colspan ? q.colspan : 1));
                        a.cols[d + 1][r] = q
                    }
                }
                l.CHILD_COLS = m;
                l.PARENT_COL_INDEX || g.push(l);
                a.cols[d][h] = l
            } else f.splice(h, 1)
        }
        this.options = k.extend(!0, {}, J, a);
        this.options.colArrays = g;
        this.options.url ? this.options.reqData = function (n, u) {
            c.options.where || (c.options.where = {});
            n && (c.options.where[c.options.request.pidName] = n[c.options.tree.idName]);
            (c.options.useAdmin ?
                layui.admin : k).ajax({
                url: c.options.url,
                data: c.options.contentType && 0 === c.options.contentType.indexOf("application/json") ? JSON.stringify(c.options.where) : c.options.where,
                headers: c.options.headers,
                type: c.options.method,
                dataType: "json",
                contentType: c.options.contentType,
                success: function (x) {
                    c.options.parseData && (x = c.options.parseData(x));
                    0 == x.code ? u(x.data) : u(x.msg || "\u52a0\u8f7d\u5931\u8d25")
                },
                error: function (x) {
                    u(x.status + " - " + x.statusText)
                }
            })
        } : this.options.data && 0 < this.options.data.length && this.options.tree.isPidData &&
            (this.options.data = z.pidToChildren(this.options.data, this.options.tree.idName, this.options.tree.pidName, this.options.tree.childName));
        "default" === this.options.toolbar && (this.options.toolbar = '<div>   <div class="v-tree-table-tool-item" title="\u6dfb\u52a0" lay-event="add">      <i class="layui-icon layui-icon-add-1"></i>   </div>   <div class="v-tree-table-tool-item" title="\u4fee\u6539" lay-event="update">      <i class="layui-icon layui-icon-edit"></i>   </div>   <div class="v-tree-table-tool-item" title="\u5220\u9664" lay-event="delete">      <i class="layui-icon layui-icon-delete"></i>   </div></div>');
        void 0 === this.options.defaultToolbar && (this.options.defaultToolbar = ["filter", "exports", "print"]);
        if ("string" === typeof this.options.tree.getIcon) {
            var v = this.options.tree.getIcon;
            this.options.tree.getIcon = function (n) {
                if ("v-tree-icon-style2" !== v) return v;
                var u = n[this.haveChildName];
                void 0 !== u ? (u = !0 === u || "true" === u, this.haveChildReverse && (u = !u)) : n[this.childName] && (u = 0 < n[this.childName].length);
                return u ? '<i class="v-tree-icon v-tree-icon-folder"></i>' : '<i class="v-tree-icon v-tree-icon-file"></i>'
            }
        }
    };
    p.prototype.init = function () {
        function a(h) {
            if (h = h.data("parent")) {
                h = e.$table.children("thead").children("tr").children('[data-key="' + h + '"]');
                var l = h.attr("colspan") - 1;
                h.attr("colspan", l);
                0 === l && h.addClass("layui-hide");
                a(h)
            }
        }

        var b = this.options, c = k(b.elem), g = b.elem.substring(1);
        c.removeAttr("lay-filter");
        0 === c.next(".v-tree-table").length && (c.css("display", "none"), c.after(['<div class="layui-form v-tree-table" lay-filter="', g, '" style="', b.style || "", '">   <div class="v-tree-table-tool" style="display: none;"></div>   <div class="v-tree-table-head">      <table class="layui-table"></table>   </div>   <div class="v-tree-table-box">      <table class="layui-table"></table>      <div class="v-tree-table-loading">         <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>      </div>      <div class="v-tree-table-empty">',
            b.text.none || "", "</div>   </div></div>"].join("")));
        var e = this.getComponents();
        b.skin && e.$table.attr("lay-skin", b.skin);
        b.size && e.$table.attr("lay-size", b.size);
        b.even && e.$table.attr("lay-even", b.even);
        e.$toolbar.empty();
        if (!1 === b.toolbar || void 0 === b.toolbar) e.$toolbar.hide(); else {
            e.$toolbar.show();
            "string" === typeof b.toolbar && D(k(b.toolbar).html()).render({}, function (h) {
                e.$toolbar.html('<div style="display: inline-block;">' + h + "</div>")
            });
            c = ['<div class="v-tree-table-tool-right">'];
            for (var d = 0; d <
            b.defaultToolbar.length; d++) {
                var f;
                if (f = "filter" === b.defaultToolbar[d] ? {
                    title: "\u7b5b\u9009",
                    layEvent: "LAYTABLE_COLS",
                    icon: "layui-icon-cols"
                } : "exports" === b.defaultToolbar[d] ? {
                    title: "\u5bfc\u51fa",
                    layEvent: "LAYTABLE_EXPORT",
                    icon: "layui-icon-export"
                } : "print" === b.defaultToolbar[d] ? {
                    title: "\u6253\u5370",
                    layEvent: "LAYTABLE_PRINT",
                    icon: "layui-icon-print"
                } : b.defaultToolbar[d]) c.push('<div class="v-tree-table-tool-item"'), c.push(' title="' + f.title + '"'), c.push(' lay-event="' + f.layEvent + '">'), c.push('<i class="layui-icon ' +
                    f.icon + '"></i></div>')
            }
            e.$toolbar.append(c.join("") + "</div>")
        }
        b.width && (e.$view.css("width", b.width), e.$tHeadGroup.css("width", b.width), e.$tBodyGroup.css("width", b.width));
        c = this.resize(!0);
        d = "<thead>" + this.renderBodyTh() + "</thead>";
        e.$tBodyGroup.children("style").remove();
        b.height ? (e.$tHead.html(c + d), e.$tBody.html(c + "<tbody></tbody>"), 0 === b.height.indexOf("full-") ? (c = parseFloat(b.height.substring(5)) + e.$toolbar.outerHeight() + e.$tHeadGroup.outerHeight() + 1, e.$tBodyGroup.append(['<style>[lay-filter="',
            g, '"] .v-tree-table-box {   height: ', (document.documentElement.clientHeight || document.body.clientHeight) - c, "px;   height: -moz-calc(100vh - ", c, "px);   height: -webkit-calc(100vh - ", c, "px);   height: calc(100vh - ", c, "px);}</style>"].join("")), e.$tBodyGroup.data("full", c), e.$tBodyGroup.css("height", "")) : (e.$tBodyGroup.css("height", b.height), e.$tBodyGroup.data("full", "")), e.$tHeadGroup.show()) : (e.$tHeadGroup.hide(), e.$tBodyGroup.append(['<style>[lay-filter="', g, '"] .v-tree-table-box:before {   content: "";   position: absolute;   top: 0; left: 0; right: 0;',
            "   height: " + {
                lg: 50,
                sm: 30,
                md: 38
            }[b.size || "md"] * b.cols.length + "px;", "   background-color: #f2f2f2;   border-bottom: 1px solid #e6e6e6;}</style>"].join("")), e.$tBody.html(c + d + "<tbody></tbody>"));
        w.render("checkbox", g);
        e.$table.children("thead").children("tr").children("th.layui-hide").each(function () {
            a(k(this))
        });
        b.reqData ? (this.options.data = void 0, this.renderBodyAsync()) : b.data && 0 < b.data.length ? this.renderBodyData(b.data) : (e.$loading.hide(), e.$empty.show())
    };
    p.prototype.bindEvents = function () {
        var a =
            this, b = this.options, c = this.getComponents(), g = c.$table.children("tbody"), e = function (d) {
            var f = k(this);
            if (!f.is("tr")) {
                var h = f.parent("tr");
                f = 0 < h.length ? h : f.parentsUntil("tr").last().parent()
            }
            var l = a.getDataByTr(f);
            return k.extend({
                tr: f, data: l, del: function () {
                    var m = f.data("index"), t = parseInt(f.data("indent"));
                    f.nextAll("tr").each(function () {
                        if (parseInt(k(this).data("indent")) <= t) return !1;
                        k(this).remove()
                    });
                    var r = "number" === typeof m ? 1 : m.split("-").length;
                    f.nextAll("tr").each(function () {
                        var v = k(this);
                        if (parseInt(v.data("indent")) <
                            t) return !1;
                        var n = v.data("index").toString().split("-");
                        n[r - 1] = parseInt(n[r - 1]) - 1;
                        v.data("index", n.join("-"))
                    });
                    var q = f.prevAll("tr");
                    a.del(void 0, m);
                    f.remove();
                    a.renderNumberCol();
                    q.each(function () {
                        var v = parseInt(k(this).data("indent"));
                        if (v >= t) return !0;
                        a.checkParentCB(k(this));
                        t = v
                    });
                    a.checkChooseAllCB();
                    0 === b.data.length && c.$empty.show();
                    y(c.$view)
                }, update: function (m) {
                    l = k.extend(!0, l, m);
                    var t = parseInt(f.data("indent"));
                    a.renderBodyTr(l, t, void 0, f);
                    w.render(null, c.filter);
                    a.renderNumberCol();
                    f.prevAll("tr").each(function () {
                        var r =
                            parseInt(k(this).data("indent"));
                        if (r >= t) return !0;
                        a.checkParentCB(k(this));
                        t = r
                    });
                    a.checkChooseAllCB()
                }
            }, d)
        };
        g.off("click.fold").on("click.fold", ".v-tree-pack", function (d) {
            layui.stope(d);
            d = k(this).parentsUntil("tr").last().parent();
            if (!d.hasClass("v-tree-table-loading")) {
                var f = d.data("have-child");
                if (!0 === f || "true" === f) {
                    f = d.hasClass("v-tree-table-open");
                    var h = a.getDataByTr(d);
                    f || h[b.tree.childName] ? h[b.tree.openName] = A(d) : a.renderBodyAsync(h, d)
                }
            }
        });
        g.off("click.tool").on("click.tool", "*[lay-event]",
            function (d) {
                layui.stope(d);
                d = k(this);
                layui.event.call(this, "treeTable", "tool(" + c.filter + ")", e.call(this, {event: d.attr("lay-event")}))
            });
        w.on("radio(" + c.radioFilter + ")", function (d) {
            d = a.getDataByTr(k(d.elem).parentsUntil("tr").last().parent());
            a.removeAllChecked();
            d.LAY_CHECKED = !0;
            d.LAY_INDETERMINATE = !1;
            layui.event.call(this, "treeTable", "checkbox(" + c.filter + ")", {checked: !0, data: d, type: "one"})
        });
        w.on("checkbox(" + c.checkboxFilter + ")", function (d) {
            var f = d.elem.checked;
            d = k(d.elem);
            var h = d.next(".layui-form-checkbox");
            !f && d.hasClass("v-form-indeterminate") && (f = !0, d.prop("checked", f), h.addClass("layui-form-checked"), d.removeClass("v-form-indeterminate"));
            d = d.parentsUntil("tr").last().parent();
            h = a.getDataByTr(d);
            h.LAY_CHECKED = f;
            h.LAY_INDETERMINATE = !1;
            h[b.tree.childName] && 0 < h[b.tree.childName].length && a.checkSubCB(d, f);
            var l = parseInt(d.data("indent"));
            d.prevAll("tr").each(function () {
                var m = parseInt(k(this).data("indent"));
                m < l && (a.checkParentCB(k(this)), l = m)
            });
            a.checkChooseAllCB();
            layui.event.call(this, "treeTable",
                "checkbox(" + c.filter + ")", {checked: f, data: h, type: "more"})
        });
        w.on("checkbox(" + c.chooseAllFilter + ")", function (d) {
            var f = d.elem.checked;
            d = k(d.elem);
            var h = d.next(".layui-form-checkbox");
            b.data && 0 !== b.data.length ? (!f && d.hasClass("v-form-indeterminate") && (f = !0, d.prop("checked", f), h.addClass("layui-form-checked"), d.removeClass("v-form-indeterminate")), layui.event.call(this, "treeTable", "checkbox(" + c.filter + ")", {
                checked: f,
                type: "all"
            }), a.checkSubCB(c.$tBody.children("tbody"), f)) : (d.prop("checked", !1), h.removeClass("layui-form-checked"),
                d.removeClass("v-form-indeterminate"))
        });
        g.off("click.row").on("click.row", "tr", function () {
            layui.event.call(this, "treeTable", "row(" + c.filter + ")", e.call(this, {}))
        });
        g.off("dblclick.rowDouble").on("dblclick.rowDouble", "tr", function () {
            layui.event.call(this, "treeTable", "rowDouble(" + c.filter + ")", e.call(this, {}))
        });
        g.off("click.cell").on("click.cell", "td", function (d) {
            var f = k(this), h = f.data("type");
            if ("checkbox" === h || "radio" === h) return layui.stope(d);
            h = f.data("edit");
            var l = f.data("field");
            if (h) {
                if (layui.stope(d),
                    !(0 < g.find(".v-tree-table-edit").length)) {
                    var m = f.data("index"), t = f.find(".v-tree-table-indent").length, r = a.getDataByTr(f.parent());
                    "text" === h || "number" === h ? (d = k('<input type="' + h + '" class="layui-input v-tree-table-edit"/>'), d[0].value = r[l], f.append(d), d.focus(), d.blur(function () {
                        var q = k(this).val();
                        if (q == r[l]) return k(this).remove();
                        !1 === layui.event.call(this, "treeTable", "edit(" + c.filter + ")", e.call(this, {
                            value: q,
                            field: l
                        })) ? (k(this).addClass("layui-form-danger"), k(this).focus()) : (r[l] = q, q = f.data("key").split("-"),
                            a.renderBodyTd(r, t, m, f, b.cols[q[0]][q[1]]))
                    })) : console.error("\u4e0d\u652f\u6301\u7684\u5355\u5143\u683c\u7f16\u8f91\u7c7b\u578b:" + h)
                }
            } else !1 === layui.event.call(this, "treeTable", "cell(" + c.filter + ")", e.call(this, {
                td: f,
                field: l
            })) && layui.stope(d)
        });
        g.off("dblclick.cellDouble").on("dblclick.cellDouble", "td", function (d) {
            var f = k(this), h = f.data("type");
            if ("checkbox" === h || "radio" === h) return layui.stope(d);
            h = f.data("edit");
            var l = f.data("field");
            if (h) return layui.stope(d);
            !1 === layui.event.call(this, "treeTable",
                "cellDouble(" + c.filter + ")", e.call(this, {td: f, field: l})) && layui.stope(d)
        });
        c.$toolbar.off("click.toolbar").on("click.toolbar", "*[lay-event]", function (d) {
            layui.stope(d);
            d = k(this);
            var f = d.attr("lay-event");
            "LAYTABLE_COLS" === f ? a.toggleCol() : "LAYTABLE_EXPORT" === f ? a.exportData("show") : "LAYTABLE_PRINT" === f ? a.printTable() : layui.event.call(this, "treeTable", "toolbar(" + c.filter + ")", {
                event: f,
                elem: d
            })
        });
        c.$tBodyGroup.on("scroll", function () {
            var d = k(this);
            c.$tHeadGroup.scrollLeft(d.scrollLeft())
        });
        c.$toolbar.off("click.export").on("click.export",
            ".layui-table-tool-panel>[data-type]", function () {
                var d = k(this).data("type");
                "csv" !== d && "xls" !== d || a.exportData(d)
            });
        c.$toolbar.off("click.panel").on("click.panel", ".layui-table-tool-panel", function (d) {
            layui.stope(d)
        });
        w.on("checkbox(" + c.colsToggleFilter + ")", function (d) {
            a.toggleCol(d.elem.checked, void 0, d.value)
        })
    };
    p.prototype.getComponents = function () {
        var a = k(this.options.elem).next(".v-tree-table"), b = a.attr("lay-filter"),
            c = a.children(".v-tree-table-head"), g = a.children(".v-tree-table-box");
        return {
            $view: a,
            filter: b,
            $tHeadGroup: c,
            $tBodyGroup: g,
            $tHead: c.children(".layui-table"),
            $tBody: g.children(".layui-table"),
            $table: a.find(".layui-table"),
            $toolbar: a.children(".v-tree-table-tool"),
            $empty: g.children(".v-tree-table-empty"),
            $loading: g.children(".v-tree-table-loading"),
            checkboxFilter: "ew_tb_checkbox_" + b,
            radioFilter: "ew_tb_radio_" + b,
            chooseAllFilter: "ew_tb_choose_all_" + b,
            colsToggleFilter: "ew_tb_toggle_cols" + b
        }
    };
    p.prototype.eachCols = function (a, b) {
        b || (b = this.options.colArrays);
        for (var c = 0; c < b.length; c++) {
            var g =
                b[c];
            a && a(c, g);
            g.CHILD_COLS && this.eachCols(a, g.CHILD_COLS)
        }
    };
    p.prototype.eachData = function (a, b) {
        b || (b = this.options.data);
        for (var c = 0; c < b.length; c++) {
            var g = b[c];
            a && a(c, g);
            g[this.options.tree.childName] && this.eachData(a, g[this.options.tree.childName])
        }
    };
    p.prototype.renderBodyAsync = function (a, b) {
        var c = this, g = this.options, e = this.getComponents();
        b ? (b.addClass("v-tree-table-loading"), b.find(".v-tree-pack").children(".v-tree-table-arrow").addClass("layui-anim layui-anim-rotate layui-anim-loop")) : (e.$empty.hide(),
        g.data && 0 < g.data.length && e.$loading.addClass("v-loading-float"), e.$loading.show());
        g.reqData(a, function (d) {
            "string" !== typeof d && d && 0 < d.length && g.tree.isPidData && (d = z.pidToChildren(d, g.tree.idName, g.tree.pidName, g.tree.childName));
            c.renderBodyData(d, a, b)
        })
    };
    p.prototype.renderBodyData = function (a, b, c) {
        if ("string" === typeof a) {
            var g = a;
            a = []
        }
        var e = this, d = this.options, f = this.getComponents();
        void 0 === b ? d.data = a : b[d.tree.childName] = a;
        if (c) {
            var h = parseInt(c.data("indent")) + 1;
            b[d.tree.openName] = !0
        }
        var l = this.renderBody(a,
            h, b);
        c ? (c.nextAll("tr").each(function () {
            if (parseInt(k(this).data("indent")) <= h - 1) return !1;
            k(this).remove()
        }), c.after(l).addClass("v-tree-table-open")) : f.$tBody.children("tbody").html(l);
        w.render(null, f.filter);
        this.renderNumberCol();
        c ? (this.checkParentCB(c), c.prevAll("tr").each(function () {
            var m = parseInt(k(this).data("indent"));
            m < h - 1 && (e.checkParentCB(k(this)), h = m + 1)
        }), c.removeClass("v-tree-table-loading"), l = c.find(".v-tree-pack").children(".v-tree-table-arrow"), l.removeClass("layui-anim layui-anim-rotate layui-anim-loop"),
            g ? c.removeClass("v-tree-table-open") : a && 0 === a.length && (b[d.tree.haveChildName] = !!d.tree.haveChildReverse, c.data("have-child", !1), l.addClass("v-tree-table-arrow-hide"), l.next(".v-tree-icon").after(d.tree.getIcon(b)).remove())) : (f.$loading.hide(), f.$loading.removeClass("v-loading-float"), a && 0 < a.length ? f.$empty.hide() : (f.$empty.show(), g ? f.$empty.text(g) : f.$empty.html(d.text.none)));
        this.checkChooseAllCB();
        y(f.$view);
        d.done && d.done(a)
    };
    p.prototype.renderBody = function (a, b, c, g) {
        var e = this.options;
        b || (b =
            0);
        var d = "";
        if (!a || 0 === a.length) return d;
        var f = c ? !c[e.tree.openName] : void 0;
        g && (f = g);
        for (var h = 0; h < a.length; h++) {
            var l = a[h];
            l.LAY_INDEX = (c ? c.LAY_INDEX + "-" : "") + h;
            d += this.renderBodyTr(l, b, f);
            d += this.renderBody(l[e.tree.childName], b + 1, l, g)
        }
        return d
    };
    p.prototype.renderBodyTr = function (a, b, c, g) {
        var e = this, d = this.options;
        b || (b = 0);
        var f = a[d.tree.haveChildName];
        d.tree.haveChildReverse && (f = !f);
        void 0 === f && (f = a[d.tree.childName] && 0 < a[d.tree.childName].length);
        g && (g.data("have-child", f ? "true" : "false"), g.data("indent",
            b), g.removeClass("v-tree-table-loading"));
        var h = "<tr", l = "";
        f && a[d.tree.openName] && (l += "v-tree-table-open");
        c && (l += "v-tree-tb-hide");
        h += ' class="' + l + '"';
        f && (h += ' data-have-child="' + f + '"');
        h += ' data-index="' + a.LAY_INDEX + '"';
        h += ' data-indent="' + b + '">';
        var m = 0;
        this.eachCols(function (t, r) {
            r.colGroup || (h += e.renderBodyTd(a, b, m, g ? g.children("td").eq(m) : void 0, r), m++)
        });
        return h += "</tr>"
    };
    p.prototype.renderBodyTd = function (a, b, c, g, e) {
        if (!e || e.colGroup) return "";
        var d = this.options, f = this.getComponents();
        b || (b =
            0);
        var h = "", l = "";
        l = "";
        "numbers" === e.type ? h = '<span class="v-tree-table-numbers"></span>' : "checkbox" === e.type ? h = ['<input type="checkbox"', a.LAY_CHECKED ? ' checked="checked"' : "", ' lay-filter="', f.checkboxFilter, '" lay-skin="primary" class="v-tree-table-checkbox', a.LAY_INDETERMINATE ? " v-form-indeterminate" : "", '" />'].join("") : "radio" === e.type ? h = ['<input type="radio"', a.LAY_CHECKED ? ' checked="checked"' : "", ' lay-filter="', f.radioFilter, '" name="', f.radioFilter, '" class="v-tree-table-radio" />'].join("") :
            e.templet ? "function" === typeof e.templet ? h = e.templet(a) : "string" === typeof e.templet && D(k(e.templet).html()).render(a, function (m) {
                h = m
            }) : e.toolbar ? "function" === typeof e.toolbar ? h = e.toolbar(a) : "string" === typeof e.toolbar && D(k(e.toolbar).html()).render(a, function (m) {
                h = m
            }) : e.field && void 0 !== a[e.field] && null !== a[e.field] && (h = G.escape(0 === a[e.field] ? "0" : a[e.field]));
        if (c === d.tree.iconIndex) {
            for (c = 0; c < b; c++) l += '<span class="v-tree-table-indent"></span>';
            b = a[d.tree.haveChildName];
            d.tree.haveChildReverse && (b =
                !b);
            void 0 === b && (b = a[d.tree.childName] && 0 < a[d.tree.childName].length);
            l = l + '<span class="v-tree-pack"><i class="v-tree-table-arrow layui-icon' + (b ? "" : " v-tree-table-arrow-hide") + (" " + (d.tree.arrowType || "") + '"></i>');
            l += d.tree.getIcon(a);
            h = "<span>" + h + "</span>";
            h = d.tree.onlyIconControl ? l + "</span>" + h : l + h + "</span>"
        }
        l = ['<div class="v-tree-table-cell', void 0 === e.singleLine || e.singleLine ? " single-line" : "", '"', e.align ? ' align="' + e.align + '"' : "", '>   <div class="v-tree-table-cell-content">', h, '</div>   <i class="layui-icon layui-icon-close v-tree-tips-c"></i>   <div class="layui-table-grid-down" style="display: none;"><i class="layui-icon layui-icon-down"></i></div></div>'].join("");
        g && g.html(l);
        a = "<td";
        e.field && (a += ' data-field="' + e.field + '"');
        e.edit && (a += ' data-edit="' + e.edit + '"');
        e.type && (a += ' data-type="' + e.type + '"');
        e.key && (a += ' data-key="' + e.key + '"');
        e.style && (a += ' style="' + e.style + '"');
        e["class"] ? a += ' class="' + e["class"] + (e.hide ? " layui-hide" : "") + '"' : e.hide && (a += ' class="layui-hide"');
        return a + (">" + l + "</td>")
    };
    p.prototype.renderBodyTh = function () {
        var a = this.options, b = this.getComponents(), c = [];
        k.each(a.cols, function (g, e) {
            c.push("<tr>");
            k.each(e, function (d, f) {
                c.push("<th");
                f.colspan && c.push(' colspan="' + f.colspan + '"');
                f.rowspan && c.push(' rowspan="' + f.rowspan + '"');
                f.type && c.push(' data-type="' + f.type + '"');
                f.key && c.push(' data-key="' + f.key + '"');
                f.parentKey && c.push(' data-parent="' + f.parentKey + '"');
                f.hide && c.push(' class="layui-hide"');
                c.push(">");
                c.push('<div class="v-tree-table-cell' + (void 0 === f.singleLine || f.singleLine ? " single-line" : "") + '"');
                (f.thAlign || f.align) && c.push(' align="' + (f.thAlign || f.align) + '"');
                c.push(">");
                c.push('<div class="v-tree-table-cell-content">');
                d = '<input type="checkbox" lay-filter="' + b.chooseAllFilter + '" lay-skin="primary" class="v-tree-table-checkbox"/>';
                "checkbox" === f.type ? c.push(d) : c.push(f.title || "");
                c.push('</div><i class="layui-icon layui-icon-close v-tree-tips-c"></i>');
                c.push('<div class="layui-table-grid-down" style="display: none;"><i class="layui-icon layui-icon-down"></i></div></div>');
                f.colGroup || f.unresize || c.push('<span class="v-tb-resize"></span>');
                c.push("</th>")
            });
            c.push("</tr>")
        });
        return c.join("")
    };
    p.prototype.resize =
        function (a) {
            var b = this.options, c = this.getComponents(), g = 1, e = 1, d = !0, f = 0;
            this.eachCols(function (l, m) {
                m.colGroup || m.hide || (m.width ? (e += m.width + 1, m.minWidth ? m.width < m.minWidth && (m.width = m.minWidth) : m.width < b.cellMinWidth && (m.width = b.cellMinWidth)) : d = !1, m.width ? g += m.width + 1 : m.minWidth ? (g += m.minWidth + 1, f += m.minWidth) : (g += b.cellMinWidth + 1, f += b.cellMinWidth))
            });
            g ? (c.$tHead.css("min-width", g), c.$tBody.css("min-width", g)) : (c.$tHead.css("min-width", "auto"), c.$tBody.css("min-width", "auto"));
            d ? (c.$tHead.css("width",
                e), c.$tBody.css("width", e)) : (c.$tHead.css("width", "100%"), c.$tBody.css("width", "100%"));
            var h = [];
            this.eachCols(function (l, m) {
                m.colGroup || m.hide || (h.push("<col"), m.width ? h.push(' width="' + m.width + '"') : m.minWidth ? h.push(' width="' + (m.minWidth / f * 100).toFixed(2) + '%"') : h.push(' width="' + (b.cellMinWidth / f * 100).toFixed(2) + '%"'), m.type && h.push(' data-type="' + m.type + '"'), m.key && h.push(' data-key="' + m.key + '"'), h.push("/>"))
            });
            h = h.join("");
            if (a) return "<colgroup>" + h + "</colgroup>";
            c.$table.children("colgroup").html(h)
        };
    p.prototype.getDataByTr = function (a) {
        var b;
        "string" !== typeof a && "number" !== typeof a ? a && (b = a.data("index")) : b = a;
        if (void 0 !== b) {
            b = "number" === typeof b ? [b] : b.split("-");
            for (a = 0; a < b.length; a++) var c = c ? c[this.options.tree.childName][b[a]] : this.options.data[b[a]];
            return c
        }
    };
    p.prototype.checkSubCB = function (a, b) {
        var c = this, g = this.getComponents(), e = -1;
        a.is("tbody") ? a = a.children("tr") : (e = parseInt(a.data("indent")), a = a.nextAll("tr"));
        a.each(function () {
            if (parseInt(k(this).data("indent")) <= e) return !1;
            var d = k(this).children("td").find('input[lay-filter="' +
                g.checkboxFilter + '"]');
            d.prop("checked", b);
            d.removeClass("v-form-indeterminate");
            b ? d.next(".layui-form-checkbox").addClass("layui-form-checked") : d.next(".layui-form-checkbox").removeClass("layui-form-checked");
            d = c.getDataByTr(k(this));
            d.LAY_CHECKED = b;
            d.LAY_INDETERMINATE = !1
        })
    };
    p.prototype.checkParentCB = function (a) {
        var b = this.options, c = this.getComponents(), g = this.getDataByTr(a), e = 0, d = 0;
        if (g[b.tree.childName]) {
            var f = function (h) {
                for (var l = 0; l < h.length; l++) h[l].LAY_CHECKED ? e++ : d++, h[l][b.tree.childName] &&
                f(h[l][b.tree.childName])
            };
            f(g[b.tree.childName])
        }
        a = a.children("td").find('input[lay-filter="' + c.checkboxFilter + '"]');
        0 < e && 0 === d ? (a.prop("checked", !0), a.removeClass("v-form-indeterminate"), a.next(".layui-form-checkbox").addClass("layui-form-checked"), g.LAY_CHECKED = !0, g.LAY_INDETERMINATE = !1) : 0 === e && 0 < d ? (a.prop("checked", !1), a.removeClass("v-form-indeterminate"), a.next(".layui-form-checkbox").removeClass("layui-form-checked"), g.LAY_CHECKED = !1, g.LAY_INDETERMINATE = !1) : 0 < e && 0 < d && (a.prop("checked", !0),
            a.data("indeterminate", "true"), a.addClass("v-form-indeterminate"), a.next(".layui-form-checkbox").addClass("layui-form-checked"), g.LAY_CHECKED = !0, g.LAY_INDETERMINATE = !0)
    };
    p.prototype.checkChooseAllCB = function () {
        function a(d) {
            for (var f = 0; f < d.length; f++) d[f].LAY_CHECKED ? g++ : e++, d[f][b.tree.childName] && a(d[f][b.tree.childName])
        }

        var b = this.options, c = this.getComponents(), g = 0, e = 0;
        a(b.data);
        c = c.$view.find('input[lay-filter="' + c.chooseAllFilter + '"]');
        0 < g && 0 === e ? (c.prop("checked", !0), c.removeClass("v-form-indeterminate"),
            c.next(".layui-form-checkbox").addClass("layui-form-checked")) : 0 === g && 0 < e || 0 === g && 0 === e ? (c.prop("checked", !1), c.removeClass("v-form-indeterminate"), c.next(".layui-form-checkbox").removeClass("layui-form-checked")) : 0 < g && 0 < e && (c.prop("checked", !0), c.addClass("v-form-indeterminate"), c.next(".layui-form-checkbox").addClass("layui-form-checked"))
    };
    p.prototype.renderNumberCol = function () {
        this.getComponents().$tBody.children("tbody").children("tr").each(function (a) {
            k(this).children("td").find(".v-tree-table-numbers").text(a +
                1)
        })
    };
    p.prototype.getIndexById = function (a) {
        function b(g, e) {
            for (var d = 0; d < g.length; d++) {
                if (g[d][c.tree.idName] === a) return void 0 !== e ? e + "-" + d : d;
                if (g[d][c.tree.childName]) {
                    var f = b(g[d][c.tree.childName], void 0 !== e ? e + "-" + d : d);
                    if (f) return f
                }
            }
        }

        var c = this.options;
        return b(c.data)
    };
    p.prototype.expand = function (a, b) {
        a = this.getComponents().$table.children("tbody").children('tr[data-index="' + this.getIndexById(a) + '"]');
        a.hasClass("v-tree-table-open") || a.children("td").find(".v-tree-pack").trigger("click");
        if (!1 !==
            b) {
            var c = parseInt(a.data("indent"));
            a.prevAll("tr").each(function () {
                var g = parseInt(k(this).data("indent"));
                g < c && (k(this).hasClass("v-tree-table-open") || k(this).children("td").find(".v-tree-pack").trigger("click"), c = g)
            })
        }
    };
    p.prototype.fold = function (a) {
        a = this.getComponents().$table.children("tbody").children('tr[data-index="' + this.getIndexById(a) + '"]');
        a.hasClass("v-tree-table-open") && a.children("td").find(".v-tree-pack").trigger("click")
    };
    p.prototype.expandAll = function () {
        this.getComponents().$table.children("tbody").children("tr").each(function () {
            k(this).hasClass("v-tree-table-open") ||
            k(this).children("td").find(".v-tree-pack").trigger("click")
        })
    };
    p.prototype.foldAll = function () {
        this.getComponents().$table.children("tbody").children("tr").each(function () {
            k(this).hasClass("v-tree-table-open") && k(this).children("td").find(".v-tree-pack").trigger("click")
        })
    };
    p.prototype.getData = function () {
        return this.options.data
    };
    p.prototype.reload = function (a) {
        this.initOptions(this.options ? k.extend(!0, this.options, a) : a);
        this.init();
        this.bindEvents()
    };
    p.prototype.checkStatus = function (a) {
        void 0 === a &&
        (a = !0);
        var b = [];
        this.eachData(function (c, g) {
            !a && g.LAY_INDETERMINATE || !g.LAY_CHECKED || b.push(k.extend({isIndeterminate: g.LAY_INDETERMINATE}, g))
        });
        return b
    };
    p.prototype.setChecked = function (a) {
        var b = this, c = this.getComponents(), g = c.$table.find('input[lay-filter="' + c.radioFilter + '"]');
        0 < g.length ? g.each(function () {
            var e = b.getDataByTr(k(this).parentsUntil("tr").parent());
            if (e && a[a.length - 1] == e[b.options.tree.idName]) return k(this).next(".layui-form-radio").trigger("click"), !1
        }) : c.$table.find('input[lay-filter="' +
            c.checkboxFilter + '"]').each(function () {
            var e = k(this), d = e.next(".layui-form-checkbox"), f = e.prop("checked"),
                h = e.hasClass("v-form-indeterminate");
            e = b.getDataByTr(e.parentsUntil("tr").parent());
            for (var l = 0; l < a.length; l++) !e || a[l] != e[b.options.tree.idName] || e[b.options.tree.childName] && 0 < e[b.options.tree.childName].length || f && !h || d.trigger("click")
        })
    };
    p.prototype.removeAllChecked = function () {
        this.checkSubCB(this.getComponents().$table.children("tbody"), !1)
    };
    p.prototype.exportData = function (a) {
        var b = this.getComponents();
        if ("show" === a) b.$toolbar.find(".layui-table-tool-panel").remove(), b.$toolbar.find('[lay-event="LAYTABLE_EXPORT"]').append('<ul class="layui-table-tool-panel">   <li data-type="csv">\u5bfc\u51fa\u5230 Csv \u6587\u4ef6</li>   <li data-type="xls">\u5bfc\u51fa\u5230 Excel \u6587\u4ef6</li></ul>'); else {
            if (E.ie) return layer.msg("\u4e0d\u652f\u6301ie\u5bfc\u51fa");
            a || (a = "xls");
            var c = [], g = [];
            this.eachCols(function (d, f) {
                "normal" !== f.type || f.hide || c.push(f.title || "")
            });
            b.$tBody.children("tbody").children("tr").each(function () {
                var d =
                    [];
                k(this).children("td").each(function () {
                    var f = k(this);
                    if ("normal" !== f.data("type") || f.hasClass("layui-hide")) return !0;
                    d.push(f.text().trim().replace(/,/g, "\uff0c"))
                });
                g.push(d.join(","))
            });
            b = document.createElement("a");
            var e = encodeURIComponent(c.join(",") + "\r\n" + g.join("\r\n"));
            b.href = "data:" + {csv: "text/csv", xls: "application/vnd.ms-excel"}[a] + ";charset=utf-8,\ufeff" + e;
            b.download = (this.options.title || "table") + "." + a;
            document.body.appendChild(b);
            b.click();
            document.body.removeChild(b)
        }
    };
    p.prototype.printTable =
        function () {
            function a(d) {
                if (d = d.data("parent")) {
                    d = e.children("thead").children("tr").children('[data-key="' + d + '"]');
                    var f = parseInt(d.attr("colspan")) - 1;
                    d.attr("colspan", f);
                    0 === f && d.remove();
                    a(d)
                }
            }

            var b = this.getComponents(), c = b.$tHead.children("thead").html();
            c || (c = b.$tBody.children("thead").html());
            var g = b.$tBody.children("tbody").html();
            b = b.$tBody.children("colgroup").html();
            var e = k(['<table class="v-tree-table-print">   <colgroup>', b, "</colgroup>   <thead>", c, "</thead>   <tbody>", g, "</tbody></table>"].join(""));
            e.find('col[data-type="checkbox"],col[data-type="radio"],col[data-type="tool"]').remove();
            e.find('td[data-type="checkbox"],td[data-type="radio"],td[data-type="tool"],.layui-hide').remove();
            e.find('th[data-type="checkbox"],th[data-type="radio"],th[data-type="tool"]').each(function () {
                a(k(this))
            }).remove();
            c = window.open("", "_blank");
            c.focus();
            g = c.document;
            g.open();
            g.write(e[0].outerHTML + '<style>   /* \u6253\u5370\u8868\u683c\u6837\u5f0f */   .v-tree-table-print {      border: none;      border-collapse: collapse;      width: 100%;      table-layout: fixed;   }   .v-tree-table-print td, .v-tree-table-print th {      color: #555;      font-size: 14px;      padding: 9px 15px;      word-break: break-all;      border: 1px solid #888;      text-align: left;   }   .v-tree-table-print .v-tree-table-cell {      min-height: 20px;   }   /* \u5e8f\u53f7\u5217\u6837\u5f0f */   .v-tree-table-print td[data-type="numbers"], .v-tree-table-print th[data-type="numbers"] {      padding-left: 0;      padding-right: 0;   }   /* \u5355/\u590d\u9009\u6846\u5217\u6837\u5f0f */   .v-tree-table-print td[data-type="tool"], .v-tree-table-print th[data-type="tool"],    .v-tree-table-print td[data-type="checkbox"], .v-tree-table-print th[data-type="checkbox"],    .v-tree-table-print td[data-type="radio"], .v-tree-table-print th[data-type="radio"] {      border: none;   }   .v-tree-table-print td.layui-hide + td, .v-tree-table-print th.layui-hide + th,    .v-tree-table-print td[data-type="tool"] + td, .v-tree-table-print th[data-type="tool"] + th,    .v-tree-table-print td[data-type="checkbox"] + td, .v-tree-table-print th[data-type="checkbox"] + th,    .v-tree-table-print td[data-type="radio"] + td, .v-tree-table-print th[data-type="radio"] + th {      border-left: none;   }  /* \u4e0d\u663e\u793a\u7684\u5143\u7d20 */   .layui-hide,    .v-tree-table-print td[data-type="tool"] *, .v-tree-table-print th[data-type="tool"] *,    .v-tree-table-print td[data-type="checkbox"] *, .v-tree-table-print th[data-type="checkbox"] *,    .v-tree-table-print td[data-type="radio"] *, .v-tree-table-print th[data-type="radio"] *,    .layui-table-grid-down, .v-tree-tips-c, .v-tree-icon, .v-tree-table-arrow.v-tree-table-arrow-hide {      display: none;   }   /* tree\u7f29\u8fdb */   .v-tree-table-indent {      padding-left: 13px;   }   /* \u7bad\u5934 */   .v-tree-table-arrow {      position: relative;      padding-left: 13px;   }   .v-tree-table-arrow:before {      content: "";      border: 5px solid transparent;      border-top-color: #666;      position: absolute;      left: 0;      top: 6px;   }</style>');
            g.close();
            c.print();
            c.close()
        };
    p.prototype.toggleCol = function (a, b, c) {
        var g = this.getComponents();
        if (void 0 === a) {
            g.$toolbar.find(".layui-table-tool-panel").remove();
            var e = ['<ul class="layui-table-tool-panel">'];
            this.eachCols(function (l, m) {
                "normal" === m.type && (e.push('<li><input type="checkbox" lay-skin="primary"'), e.push(' lay-filter="' + g.colsToggleFilter + '"'), e.push(' value="' + m.key + '" title="' + G.escape(m.title || "") + '"'), e.push((m.hide ? "" : " checked") + "></li>"))
            });
            g.$toolbar.find('[lay-event="LAYTABLE_COLS"]').append(e.join("") +
                "</ul>");
            w.render("checkbox", g.filter)
        } else if (c) {
            var d = function (l) {
                if (l = l.data("parent")) {
                    l = g.$table.children("thead").children("tr").children('[data-key="' + l + '"]');
                    var m = l.attr("colspan");
                    a ? m++ : m--;
                    l.attr("colspan", m);
                    0 === m ? l.addClass("layui-hide") : l.removeClass("layui-hide");
                    d(l)
                }
            }, f = g.$table.children("tbody").children("tr").children('[data-key="' + c + '"]');
            b = g.$table.children("thead").children("tr").children('[data-key="' + c + '"]');
            a ? (f.removeClass("layui-hide"), b.removeClass("layui-hide")) : (f.addClass("layui-hide"),
                b.addClass("layui-hide"));
            f = c.split("-");
            var h = this.options.cols[f[0]][f[1]];
            h.hide = !a;
            d(b);
            this.eachCols(function (l, m) {
                m.key === c && (m.hide = h.hide)
            });
            this.resize()
        }
    };
    p.prototype.filterData = function (a) {
        var b = this.getComponents();
        b.$loading.show();
        0 < this.options.data.length && b.$loading.addClass("v-loading-float");
        var c = b.$table.children("tbody").children("tr"), g = [];
        if ("string" === typeof a) c.each(function () {
            var h = k(this).data("index");
            k(this).children("td").each(function () {
                if (-1 !== k(this).text().indexOf(a)) return g.push(h),
                    !1
            })
        }); else for (var e = 0; e < a.length; e++) g.push(this.getIndexById(a[e]));
        c.addClass("v-tree-table-filter-hide");
        for (e = 0; e < g.length; e++) {
            var d = c.filter('[data-index="' + g[e] + '"]');
            d.removeClass("v-tree-table-filter-hide");
            var f = parseInt(d.data("indent"));
            d.nextAll("tr").each(function () {
                if (parseInt(k(this).data("indent")) <= f) return !1;
                k(this).removeClass("v-tree-table-filter-hide")
            });
            d.hasClass("v-tree-table-open") && A(d);
            d.prevAll("tr").each(function () {
                var h = parseInt(k(this).data("indent"));
                h < f && (k(this).removeClass("v-tree-table-filter-hide"),
                k(this).hasClass("v-tree-table-open") || A(k(this)), f = h)
            })
        }
        b.$loading.hide();
        b.$loading.removeClass("v-loading-float");
        0 === g.length && b.$empty.show();
        y(b.$view)
    };
    p.prototype.clearFilter = function () {
        var a = this.getComponents();
        a.$table.children("tbody").children("tr").removeClass("v-tree-table-filter-hide");
        0 < this.options.data.length && a.$empty.hide();
        y(a.$view)
    };
    p.prototype.refresh = function (a, b) {
        "Array" === C(a) && (b = a, a = void 0);
        var c = this.getComponents();
        if (void 0 !== a) {
            var g = c.$table.children("tbody").children('tr[data-index="' +
                this.getIndexById(a) + '"]');
            var e = this.getDataByTr(g)
        }
        b ? (0 < b.length && c.$loading.addClass("v-loading-float"), c.$loading.show(), 0 < b.length && this.options.tree.isPidData ? this.renderBodyData(z.pidToChildren(b, this.options.tree.idName, this.options.tree.pidName, this.options.tree.childName), e, g) : this.renderBodyData(b, e, g)) : this.renderBodyAsync(e, g)
    };
    p.prototype.del = function (a, b) {
        void 0 === b && (b = this.getIndexById(a));
        a = "number" === typeof b ? [b] : b.split("-");
        b = this.options.data;
        if (1 < a.length) for (var c = 0; c < a.length -
        1; c++) b = b[parseInt(a[c])][this.options.tree.childName];
        b.splice(a[a.length - 1], 1)
    };
    p.prototype.update = function (a, b) {
        k.extend(!0, this.getDataByTr(this.getIndexById(a)), b)
    };
    k(window).resize(function () {
        k(".v-tree-table").each(function () {
            y(k(this));
            var a = k(this).children(".v-tree-table-box"), b = a.data("full");
            b && E.ie && 10 > E.ie && a.css("height", (document.documentElement.clientHeight || document.body.clientHeight) - b)
        })
    });
    k(document).on("mouseenter", ".v-tree-table-cell.single-line", function () {
        var a = k(this).children(".v-tree-table-cell-content");
        a.prop("scrollWidth") > a.outerWidth() && k(this).children(".layui-table-grid-down").show()
    }).on("mouseleave", ".v-tree-table-cell.single-line", function () {
        k(this).children(".layui-table-grid-down").hide()
    });
    k(document).on("click", ".v-tree-table-cell>.layui-table-grid-down", function (a) {
        a.stopPropagation();
        B();
        a = k(this).parent();
        a.addClass("v-tree-tips-open");
        a.children(".layui-table-grid-down").hide();
        var b = a.parent().outerWidth() + 4;
        a.outerWidth() < b && a.children(".v-tree-table-cell-content").css({
            width: b,
            "max-width": b
        });
        b = a.parents().filter(".v-tree-table-box");
        0 === b.length && (b = a.parents().filter(".v-tree-table-head"));
        0 !== b.length && (a.outerWidth() + a.offset().left + 20 > b.offset().left + b.outerWidth() && a.addClass("v-show-left"), a.outerHeight() + a.offset().top + 10 > b.offset().top + b.outerHeight() && a.addClass("v-show-bottom"))
    });
    k(document).on("click", ".v-tree-table-cell>.v-tree-tips-c", function () {
        B()
    });
    k(document).on("click", function () {
        B();
        k(".v-tree-table .layui-table-tool-panel").remove()
    });
    k(document).on("click",
        ".v-tree-table-cell.v-tree-tips-open", function (a) {
            a.stopPropagation()
        });
    k(document).on("mousedown", ".v-tb-resize", function (a) {
        layui.stope(a);
        var b = k(this);
        b.attr("move", "true");
        var c = b.parent().data("key");
        b.data("x", a.clientX);
        (a = b.parent().parent().parent().parent().children("colgroup").children('col[data-key="' + c + '"]').attr("width")) && -1 === a.toString().indexOf("%") || (a = b.parent().outerWidth());
        b.data("width", a);
        k("body").addClass("v-tree-table-resizing")
    }).on("mousemove", function (a) {
        var b = k('.v-tree-table .v-tb-resize[move="true"]');
        if (0 !== b.length) {
            layui.stope(a);
            var c = b.data("x"), g = b.data("width"), e = parseFloat(g) + a.clientX - parseFloat(c);
            0 >= e && (e = 1);
            a = F[b.parentsUntil(".v-tree-table").last().parent().attr("lay-filter")];
            var d = b.parent().data("key");
            b = d.split("-");
            a.options.cols[b[0]][b[1]].width = e;
            a.eachCols(function (f, h) {
                h.key === d && (h.width = e)
            });
            a.resize()
        }
    }).on("mouseup", function (a) {
        k('.v-tree-table .v-tb-resize[move="true"]').attr("move", "false");
        k("body").removeClass("v-tree-table-resizing")
    }).on("mouseleave", function (a) {
        k('.v-tree-table .v-tb-resize[move="true"]').attr("move",
            "false");
        k("body").removeClass("v-tree-table-resizing")
    });
    var z = {
        render: function (a) {
            return new p(a)
        }, reload: function (a, b) {
            F[a].reload(b)
        }, on: function (a, b) {
            return layui.onevent.call(this, "treeTable", a, b)
        }, pidToChildren: function (a, b, c, g, e) {
            g || (g = "children");
            for (var d = [], f = 0; f < a.length; f++) {
                if (a[f][b] == a[f][c]) return console.error("\u7b2c" + f + "\u6761\u6570\u636e\u7684" + b + "\u4e0e" + c + "\u76f8\u540c", a[f]);
                if (void 0 === e) {
                    e = a;
                    for (var h = b, l = c, m = [], t = 0; t < e.length; t++) {
                        for (var r = !1, q = 0; q < e.length; q++) if (e[t][l] ==
                            e[q][h]) {
                            r = !0;
                            break
                        }
                        r || m.push(e[t][l])
                    }
                    e = m
                }
                a:{
                    h = a[f][c];
                    l = e;
                    if ("Array" === C(l)) for (m = 0; m < l.length; m++) if (h == l[m]) {
                        h = !0;
                        break a
                    }
                    h = h == l
                }
                h && (h = this.pidToChildren(a, b, c, g, a[f][b]), 0 < h.length && (a[f][g] = h), d.push(a[f]))
            }
            return d
        }
    };
    k("head").append('<style id="v-tree-table-css">/** \u6700\u5916\u5c42\u5bb9\u5668 */.v-tree-table {    position: relative;    border: 1px solid #e6e6e6;    border-bottom: none;    border-right: none;}.v-tree-table:before, .v-tree-table:after, .v-tree-table .v-tree-table-head:after {    content: "";    background-color: #e6e6e6;    position: absolute;    right: 0;    bottom: 0;}.v-tree-table:before {    width: 1px;    top: 0;    z-index: 1;}.v-tree-table:after, .v-tree-table .v-tree-table-head:after {    height: 1px;    left: 0;}.v-tree-table .layui-table {    margin: 0;    position: relative;    table-layout: fixed;}/** \u8868\u683c */.v-tree-table .layui-table td, .v-tree-table .layui-table th {    border-top: none;    border-left: none;    padding: 0 !important;}.v-tree-table .v-tree-table-box {    overflow: auto;    position: relative;}.v-tree-table .v-tree-table-head {    overflow: hidden;    box-sizing: border-box;    background-color: #f2f2f2;    position: relative;}/** loading */.v-tree-table div.v-tree-table-loading {    padding: 10px 0;    text-align: center;}.v-tree-table div.v-tree-table-loading > i {    color: #999;    font-size: 30px;}.v-tree-table div.v-tree-table-loading.v-loading-float {    position: absolute;    top: 0;    left: 0;    right: 0;}/** \u7a7a\u6570\u636e */.v-tree-table .v-tree-table-empty {    color: #666;    font-size: 14px;    padding: 18px 0;    text-align: center;    display: none;}/** \u5355\u5143\u683c */.v-tree-table-cell.v-tree-tips-open {    position: absolute;    top: 0;    left: 0;    padding: 0;    z-index: 9999;    background-color: #fff;    box-shadow: 3px 3px 8px rgba(0, 0, 0, .15);}thead .v-tree-table-cell.v-tree-tips-open {    background-color: #f2f2f2;}.v-tree-table-cell.v-tree-tips-open.v-show-left {    right: 0;    left: auto;    box-shadow: -3px 3px 8px rgba(0, 0, 0, .15);}.v-tree-table-cell.v-tree-tips-open.v-show-bottom {    bottom: 0;    top: auto;    box-shadow: 3px -3px 8px rgba(0, 0, 0, .15);}.v-tree-table-cell.v-tree-tips-open.v-show-left.v-show-bottom {    box-shadow: -3px -3px 8px rgba(0, 0, 0, .15);}.v-tree-table-cell > .v-tree-tips-c {    position: absolute;    right: -6px;    top: -3px;    width: 22px;    height: 22px;    line-height: 22px;    font-size: 16px;    color: #fff;    background-color: #666;    border-radius: 50%;    text-align: center;    cursor: pointer;    display: none;}table tr:first-child .v-tree-table-cell > .v-tree-tips-c {    top: 0;}.v-tree-table-cell.v-tree-tips-open > .v-tree-tips-c {    display: block;}.v-tree-table-cell.v-tree-tips-open.v-show-left > .v-tree-tips-c {    left: -6px;    right: auto;}.v-tree-table-cell > .v-tree-table-cell-content {padding: 5px 8px;line-height: 28px;}[lay-size="lg"] .v-tree-table-cell > .v-tree-table-cell-content {    line-height: 40px;}[lay-size="sm"] .v-tree-table-cell > .v-tree-table-cell-content {    padding: 1px 15px;}.v-tree-table-cell.single-line > .v-tree-table-cell-content {    overflow: hidden;    white-space: nowrap;    text-overflow: ellipsis;}.v-tree-table-cell.v-tree-tips-open > .v-tree-table-cell-content {    overflow: auto;    padding: 9px 15px;    height: auto;    min-height: 100%;    max-height: 110px;    line-height: inherit;    max-width: 260px;    width: 200px;    width: max-content;    width: -moz-max-content;    box-sizing: border-box;    white-space: normal;}.v-tree-table-cell > .layui-table-grid-down {    box-sizing: border-box;}/** \u56fe\u6807\u5217 */.v-tree-table .v-tree-pack {    cursor: pointer;    line-height: 16px;}.v-tree-table .v-tree-pack > .layui-icon, .v-tree-table .v-tree-pack > .v-tree-icon {    margin-right: 5px;}.v-tree-table .v-tree-pack > * {    vertical-align: middle;}/* \u7f29\u8fdb */.v-tree-table .v-tree-table-indent {    margin-right: 5px;    padding-left: 16px;}/* \u7bad\u5934 */.v-tree-table .v-tree-table-arrow:before {    content: "\\e623";}.v-tree-table .v-tree-table-open .v-tree-table-arrow:before {    content: "\\e625";}.v-tree-table .v-tree-table-arrow.arrow2 {    font-size: 12px;    font-weight: 600;    line-height: 16px;    height: 16px;    width: 16px;    display: inline-block;    text-align: center;    color: #888;}.v-tree-table .v-tree-table-arrow.arrow2:before {    content: "\\e602";}.v-tree-table .v-tree-table-open .v-tree-table-arrow.arrow2:before {    content: "\\e61a";}.v-tree-table-arrow.v-tree-table-arrow-hide {    visibility: hidden;}/* \u7bad\u5934\u53d8\u52a0\u8f7d\u4e2d\u72b6\u6001 */.v-tree-table tr.v-tree-table-loading > td .v-tree-table-arrow:before {    content: "\\e63d" !important;}.v-tree-table tr.v-tree-table-loading > td .v-tree-table-arrow {    margin-right: 0;}.v-tree-table tr.v-tree-table-loading > td .v-tree-table-arrow + * {    margin-left: 5px;}.v-tree-table tr.v-tree-table-loading * {    pointer-events: none !important;}/** \u6298\u53e0\u884c */.v-tree-table .v-tree-tb-hide {    display: none;}/** \u7279\u6b8a\u5217\u8c03\u6574 */.v-tree-table td[data-type="numbers"] > .v-tree-table-cell,.v-tree-table th[data-type="numbers"] > .v-tree-table-cell,.v-tree-table td[data-type="checkbox"] > .v-tree-table-cell,.v-tree-table th[data-type="checkbox"] > .v-tree-table-cell,.v-tree-table td[data-type="radio"] > .v-tree-table-cell,.v-tree-table th[data-type="radio"] > .v-tree-table-cell,.v-tree-table td[data-type="space"] > .v-tree-table-cell,.v-tree-table th[data-type="space"] > .v-tree-table-cell {    padding-left: 0;    padding-right: 0;}/* \u5355\u5143\u683c\u5185\u8868\u5355\u5143\u7d20\u6837\u5f0f\u8c03\u6574 */.v-tree-table .layui-form-switch.v-tree-table .layui-form-radio {    margin: 0;}/* checkbox\u5217\u8c03\u6574 */.v-tree-table-checkbox + .layui-form-checkbox {    padding: 0;}.v-tree-table-checkbox + .layui-form-checkbox > .layui-icon {    font-weight: 600;    color: transparent;    transition: background-color .1s linear;    -webkit-transition: background-color .1s linear;}.v-tree-table-checkbox + .layui-form-checkbox.layui-form-checked > .layui-icon {    color: #fff;}/* checkbox\u534a\u9009\u72b6\u6001 */.v-form-indeterminate + .layui-form-checkbox .layui-icon:before {    content: "";    width: 10px;    height: 2px;    background-color: #f1f1f1;    position: absolute;    top: 50%;    left: 50%;    margin: -1px 0 0 -5px;}/* radio\u5217\u8c03\u6574 */.v-tree-table-radio + .layui-form-radio {    margin: 0;    padding: 0;    height: 20px;    line-height: 20px;}.v-tree-table-radio + .layui-form-radio > i {    margin: 0;    height: 20px;    font-size: 20px;    line-height: 20px;}/** \u5355\u5143\u683c\u7f16\u8f91 */.v-tree-table .layui-table td[data-edit] {    cursor: text;}.v-tree-table .v-tree-table-edit {    position: absolute;    left: 0;    top: 0;    width: 100%;    height: 100%;    border-radius: 0;    box-shadow: 1px 1px 20px rgba(0, 0, 0, .15);}.v-tree-table .v-tree-table-edit:focus {    border-color: #5FB878 !important;}.v-tree-table .v-tree-table-edit.layui-form-danger {    border-color: #FF5722 !important;}/** \u641c\u7d22\u6570\u636e\u9690\u85cf\u884c */.v-tree-table tr.v-tree-table-filter-hide {    display: none !important;}/** \u5934\u90e8\u5de5\u5177\u680f */.v-tree-table .v-tree-table-tool {    min-height: 50px;    line-height: 30px;    padding: 10px 15px;    box-sizing: border-box;    background-color: #f2f2f2;    border-bottom: 1px solid #e6e6e6;}.v-tree-table .v-tree-table-tool .v-tree-table-tool-right {    float: right;}.v-tree-table .v-tree-table-tool .v-tree-table-tool-item {    position: relative;    color: #333;    width: 26px;    height: 26px;    line-height: 26px;    text-align: center;    margin-left: 10px;    display: inline-block;    border: 1px solid #ccc;    box-sizing: border-box;    vertical-align: middle;    -webkit-transition: .3s all;    transition: .3s all;    cursor: pointer;}.v-tree-table .v-tree-table-tool .v-tree-table-tool-item:first-child {    margin-left: 0;}.v-tree-table .v-tree-table-tool .v-tree-table-tool-item:hover {    border-color: #999;}.v-tree-table .v-tree-table-tool-right .layui-table-tool-panel {    left: auto;    right: -1px;    z-index: 9999;}/* \u5217\u5bbd\u62d6\u62fd\u8c03\u6574 */.v-tree-table .v-tb-resize {    position: absolute;    right: 0;    top: 0;    bottom: 0;    width: 10px;    cursor: col-resize;}.v-tree-table-resizing {    cursor: col-resize;    -ms-user-select: none;    -moz-user-select: none;    -webkit-user-select: none;    user-select: none;}/* \u8f85\u52a9\u6837\u5f0f */.v-tree-table .layui-form-switch {    margin: 0;}.v-tree-table .pd-tb-0 {    padding-top: 0 !important;    padding-bottom: 0 !important;}.v-tree-table .break-all {    word-break: break-all !important;}/** \u6269\u5c55\u56fe\u6807 */.v-tree-table .v-tree-icon-folder:after, .v-tree-table .v-tree-icon-file:after {    content: "";    padding: 2px 10px;    -webkit-background-size: cover;    -moz-background-size: cover;    -o-background-size: cover;    background-size: cover;    background-repeat: no-repeat;    background-image: url("");}.v-tree-table tr.v-tree-table-open > td .v-tree-icon-folder:after {    background-image: url("");}.v-tree-table .v-tree-icon-file:after {    background-image: url("");}</style>');
    I("trTable", z)
});